﻿using System.Collections.Generic;

namespace StockLib.Indicator
{
    public partial class StockMaIndicator : StockIndicator
    {
        private List<int> maDays = new List<int>();

        public StockMaIndicator()
            : base()
        {
            cacheCount = 6;
        }

        public override void SetDefaultParameters()
        {
            maDays.Clear();
            maDays.Add(5);
            maDays.Add(10);
            maDays.Add(20);
            maDays.Add(60);
            maDays.Add(120);
            maDays.Add(240);
        }

        protected override float[] CalcOutput(int index)
        {
            float[] values = new float[6];

            for (int i = 0; i < values.Length; i++)
            {
                values[i] = CalcCloseMaCache(index, maDays[i], i);
            }

            return values;
        }
    }
}
